<!--
 * @LastEditors: 七七
 * @Date: 2023-01-11 11:11:43
-->
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>数组去重</title>
</head>

<body>
  <script>
    var arr = [1, 2, 3, 2, 2, 3, 1, 6, 5, 9];

    // 数组去重
    var result = [...new Set(arr)]
    console.log(result); //[ 1, 2, 3, 6, 5, 9 ]
  </script>
</body>

</html>